home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 1 / Cream of the Crop 1.iso / PROGRAM / TOTDEMO.ARJ / DEMIN3.PAS < prev    next >
Pascal/Delphi Source File  |  1991-02-11  |  3KB  |  110 lines

  1. Program DemoInputThree;
  2. {DEMIN3}
  3.  
  4. Uses CRT,
  5.      totINPUT, totFAST, totMISC;
  6.  
  7.  
  8. {$F+}
  9. procedure ClockHook;
  10. {}
  11. begin
  12.    with Screen do
  13.    with Key do
  14.    begin
  15.       SetWinIgnore(true);
  16.       if GetCaps then
  17.          WritePlain(40,24,'CAPS')
  18.       else
  19.          WritePlain(40,24,'    ');
  20.       if GetNum then
  21.          WritePlain(45,24,'NUM')
  22.       else
  23.          WritePlain(45,24,'   ');
  24.       if GetScroll then
  25.          WritePlain(50,24,'SCROLL')
  26.       else
  27.          WritePlain(50,24,'      ');
  28.       if KeyPressed then 
  29.       begin
  30.          SetWinIgnore(false);
  31.          exit;
  32.       end;
  33.       if AltPressed then
  34.          WritePlain(60,24,'Alt')
  35.       else
  36.          WritePlain(60,24,'   ');
  37.       if CtrlPressed then
  38.          WritePlain(65,24,'Ctrl')
  39.       else
  40.          WritePlain(65,24,'    ');
  41.       if LeftShiftPressed then
  42.          WritePlain(70,24,'L-')
  43.       else
  44.          WritePlain(70,24,'   ');
  45.       if RightShiftPressed then
  46.          WritePlain(75,24,'R-')
  47.       else
  48.          WritePlain(75,24,'   ');
  49.       if KeyPressed then 
  50.       begin
  51.          SetWinIgnore(false);
  52.          exit;
  53.       end;
  54.       WritePlain(1,24,CurrentTime);
  55.       SetWinIgnore(false);
  56.    end;
  57. end; {ClockHook}
  58. {$F-}
  59.  
  60. {$F+}
  61. procedure MacroHook(var W:word);
  62. {}
  63. begin
  64.    case W of
  65.       286: begin
  66.               Key.StuffBufferStr(' Apple '); {Alt-A}
  67.               W := 0;
  68.            end;
  69.       304: begin
  70.               Key.StuffbufferStr(' Bravo '); {Alt-B}
  71.               W := 0;
  72.            end;
  73.       301: begin
  74.               Key.StuffBuffer(27);           {Alt-X}
  75.               W := 0;
  76.            end;
  77.       315: begin
  78.               Key.StuffbufferStr(' No help! '); {F1}
  79.               W := 0;
  80.            end;
  81.    end; {case}
  82. end; {MacroHook}
  83. {$F-}
  84.  
  85. begin                 
  86.    with Screen do
  87.    begin
  88.       Clear(31,' ');
  89.       PartClear(1,23,80,25,94,' ');
  90.       WritePlain(5,1,'Press any alpha characters, or Alt-A,B for macros. Esc or Alt-X to quit');
  91.       GotoXY(1,3);
  92.       with Key do
  93.       begin
  94.          SetCaps(true);
  95.          SetNum(true);
  96.          SetScroll(true);
  97.          AssignIdleHook(ClockHook);
  98.          AssignPressedHook(MacroHook);
  99.          Repeat
  100.              GetInput;
  101.              if AlphabetTot^.Isletter(Lastkey) then
  102.                 Write(char(LastKey));
  103.          Until LastKey = 27;
  104.          SetCaps(false);
  105.          SetNum(false);
  106.          SetScroll(false);
  107.       end;
  108.    end;
  109. end.
  110.